/*
 * Copyright (c) 2010 CCX(China) Co.,Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * CCX(China) Co.,Ltd. ("Confidential Information").
 * It may not be copied or reproduced in any manner without the express 
 * written permission of CCX(China) Co.,Ltd.
 *
 * Author: zhaosj
 * Date: 2011-1-18 上午10:05:06
 */
package com.quartz;

import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.Trigger;
import org.quartz.TriggerUtils;
import org.quartz.impl.StdSchedulerFactory;

/**
 * @author zhaosj
 * 
 */
public class MyQuartzServer {

	public static void main(String[] args) {
		MyQuartzServer server = new MyQuartzServer();
		try {
			server.startScheduler();
		} catch (SchedulerException ex) {
			ex.printStackTrace();
		}
	}

	protected void startScheduler() throws SchedulerException {
		// Use the factory to create a Scheduler instance
		Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler();
		// JobDetail holds the definition for Jobs
		// JobDetail jobDetail = new JobDetail("ScanFTPJob", Scheduler.DEFAULT_GROUP, ScanFTPSiteJob.class);// Store job parameters to be used within execute()jobDetail.getJobDataMap().put("FTP_HOST",
																											// "\\home\\cavaness\\inbound");
		// Other neccessary Job parameters here
		// Create a Trigger that fires every 60 seconds
		Trigger trigger = TriggerUtils.makeSecondlyTrigger(60);
		// Setup the Job and Trigger with the Scheduler
		// scheduler.scheduleJob(jobDetail, trigger);
		// Start the Scheduler running
		scheduler.start();
	}

}
